﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Carwash.CW_Storage
{
    class CW_Storage_Facade
    {
        private CW_Storage storage_instance = new CW_Storage();

        /// <summary>
        /// this method will delegate the execution of 'getPassword'
        /// to the class CW_Storage
        /// </summary>
        /// <param name="PIN"></param>
        /// <returns>returns password associated with this PIN</returns>
        public string getPassword(int PIN)
        {
            return storage_instance.getPassword(PIN);
        }
       
        /// <summary>
        /// this method will delegate the execution of 'getPINType'
        /// to the class CW_Storage
        /// </summary>
        /// <param name="PIN"></param>
        /// <returns>returns the PIN type associated with this PIN</returns>
        public string[] getPINData(int PIN)
        {
            return storage_instance.getPINData(PIN);
        }

        /// <summary>
        /// this method will delegate the execution of 'addRecord'
        /// to the class CW_Storage
        /// </summary>
        /// <param name="PIN"></param>
        /// <param name="pinType"></param>
        /// <returns>returns whether the operation was successful</returns>
        public bool addRecord(int PIN, int pinType)
        {
            return storage_instance.addRecord(PIN, pinType, null);
        }

        /// <summary>
        /// this method will delegate the execution of 'addRecord'
        /// to the class CW_Storage
        /// </summary>
        /// <param name="PIN"></param>
        /// <param name="pinType"></param>
        /// <param name="password"></param>
        /// <returns>returns whether the operation was successful</returns>
        public bool addRecord(int PIN, int pinType, string password)
        {
            return storage_instance.addRecord(PIN, pinType, password);
        }

        /// <summary>
        /// this method will delegate the execution of 'addLogEntry'
        /// to the class CW_Storage
        /// </summary>
        /// <param name="newLog"></param>
        /// <returns>returns whether the operation was successful</returns>
        public bool addLogEntry(string newLog)
        {
            return storage_instance.addLogEntry(newLog);
        }

        public ArrayList retrieveLogs()
        {
            return storage_instance.retrieveLogs();
        }
    }
}
